package com.example.demo.DAO;

import com.example.demo.Entity.Statistics;
import com.example.demo.Entity.selectionValue;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository()
public interface SelectionValueDao {

    /******** 查询所有单位 *********/
    @Select("select * from companyList")
    List<selectionValue> findAllSelect();

    /******** 查询所有单位 *********/
    @Select("select * from departmentList")
    List<selectionValue> findDepartmentList();

    /******** 查询所有单位 *********/
    @Select("select * from areaList")
    List<selectionValue> findAreaList();

    /******** 查询所有单位 *********/
    @Select("select * from typeOneList")
    List<selectionValue> findTypeOneList();

    /******** 查询所有单位 *********/
    @Select("select * from typeTwoList")
    List<selectionValue> findTypeTwoList();

    /******** 查询所有单位 *********/
    @Select("select * from financialFocusList")
    List<selectionValue> findFinancialFocusList();

    /******** 查询所有单位 *********/
    @Select("select * from typeFourList")
    List<selectionValue> findTypeFourList();

    /******** 查询所有单位 *********/
    @Select("select * from typeFiveList")
    List<selectionValue> findTypeFiveList();

    /******** 查询所有单位 *********/
    @Select("select * from typeSixList")
    List<selectionValue> findTypeSixList();

    /******** 查询所有单位 *********/
    @Select("select * from specsList")
    List<selectionValue> findSpecsList();


    /********************* 添加 *****************************/

    //添加单位选择框的值
    @Insert("insert into companyList(label,value) values(#{label},#{value})")
    void addCompanyList(selectionValue s);
    //添加部门选择框的值
    @Insert("insert into departmentList(label,value) values(#{label},#{value})")
    void addDepartmentList(selectionValue s);
    //添加区域选择框的值
    @Insert("insert into areaList(label,value) values(#{label},#{value})")
    void addAreaList(selectionValue s);
    //添加大类选择框的值
    @Insert("insert into typeOneList(label,value) values(#{label},#{value})")
    void addTypeOneList(selectionValue s);
    //添加二类选择框的值
    @Insert("insert into typeTwoList(label,value) values(#{label},#{value})")
    void addTypeTwoList(selectionValue s);
    //添加财务归口选择框的值
    @Insert("insert into financialFocusList(label,value) values(#{label},#{value})")
    void addFinancialFocusList(selectionValue s);
    //添加四类选择框的值
    @Insert("insert into typeFourList(label,value) values(#{label},#{value})")
    void addTypeFourList(selectionValue s);
    //添加五类选择框的值
    @Insert("insert into typeFiveList(label,value) values(#{label},#{value})")
    void addTypeFiveList(selectionValue s);
    //添加六类选择框的值
    @Insert("insert into typeSixList(label,value) values(#{label},#{value})")
    void addTypeSixList(selectionValue s);
    //添加计量单位选择框的值
    @Insert("insert into specsList(label,value) values(#{label},#{value})")
    void addSpecsList(selectionValue s);


    /*************************删除********************************/

    //删除单位选择框的值
    @Delete("delete from companyList where value = #{value}")
    Integer deleteCompanyList(selectionValue value);

    //删除部门选择框的值
    @Delete("delete from departmentList where value = #{value}")
    Integer deleteDepartmentList(selectionValue value);

    //删除区域选择框的值
    @Delete("delete from areaList where value = #{value}")
    Integer deleteAreaList(selectionValue value);

    //删除大类选择框的值
    @Delete("delete from typeOneList where value = #{value}")
    Integer deleteTypeOneList(selectionValue value);

    //删除二类选择框的值
    @Delete("delete from typeTwoList where value = #{value}")
    Integer deleteTypeTwoList(selectionValue value);

    //删除财务归口选择框的值
    @Delete("delete from financialFocusList where value = #{value}")
    Integer deleteFinancialFocusList(selectionValue value);

    //删除四类选择框的值
    @Delete("delete from typeFourList where value = #{value}")
    Integer deleteTypeFourList(selectionValue value);

    //删除五类选择框的值
    @Delete("delete from typeFiveList where value = #{value}")
    Integer deleteTypeFiveList(selectionValue value);

    //删除六类选择框的值
    @Delete("delete from typeSixList where value = #{value}")
    Integer deleteTypeSixList(selectionValue value);

    //删除计量单位选择框的值
    @Delete("delete from specsList where value = #{value}")
    Integer deleteSpecsList(selectionValue value);


}
